package UserName;

import java.io.InputStream;

import javax.xml.soap.SOAPConnectionFactory;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;



public class Manager {

	    private static Manager  m = new Manager();
	    private SqlSessionFactory factory;

		private Manager(){
			String config = "mybatis.xml";
			InputStream in = this.getClass().getClassLoader().getResourceAsStream(config);
			factory  = new SqlSessionFactoryBuilder().build(in);
			
		}
		public static  Manager getInstance(){
			return m;
		}
		public SqlSession getSession(){
			return factory.openSession();
		}
		
	
}
